#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTcpSocket>
#include <QString>
#include <QtWidgets>
#include "usr_info.h"

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

    USER_DATA usr_data;

    QTcpSocket *socket;

    int connect_server();

private slots:
    void login_Button_clicked();
    void register_Button_clicked();

private:
    QLabel *label_username;
    QLabel *label_passwd;
    QLineEdit *lineEdit_username;
    QLineEdit *lineEdit_passwd;
    QPushButton *login_Button;
    QPushButton *register_Button;

    void closeEvent(QCloseEvent *e);
};

#endif // DIALOG_H
